package com.yxw.live_vod_boot.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yxw.live_vod_boot.entity.YxOnDemandCollectionFolderEntity;
import com.yxw.live_vod_boot.vo.OnDemandCollectionFolderVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author fangmaoxin
 * &#064;date  2023年11月16日
 */
@Repository
public interface OnDemandCollectionFolderMapper extends BaseMapper<YxOnDemandCollectionFolderEntity> {

    void deleteVideoInFolder(@Param("userId") Long userId, @Param("collectionFolderId") Long collectionFolderId);

    int insertVideoInToCollectionFolder(@Param("userId") Long userId, @Param("videoId") Long videoId, @Param("collectionFolderId") Long collectionFolderId);

    boolean checkVideoInCollectionFolder(@Param("userId") Long userId, @Param("videoId") Long videoId, @Param("collectionFolderId") Long collectionFolderId);

    int deleteVideoInCollectionFolder(@Param("userId") Long userId, @Param("videoIds") List<Long> videoIds, @Param("collectionFolderId") Long collectionFolderId);

    boolean checkVideoInToFolder(@Param("userId") Long userId, @Param("videoIds") List<Long> videoIds, @Param("toFolderId") Long toFolderId);

    int insertVideoInToFromFolder(@Param("userId") Long userId, @Param("videoIds") List<Long> videoIds, @Param("toFolderId") Long toFolderId);

    boolean checkVideoInFromFolder(@Param("userId") Long userId, @Param("videoIds") List<Long> videoIds, @Param("fromFolderId") Long fromFolderId);

    List<OnDemandCollectionFolderVO> selectFolderListAndVideoListByUserId(Page<YxOnDemandCollectionFolderEntity> page, @Param("userId") Long userId);

    List<Long> findCollectionVideoIdsByVideoId(@Param("userId") Long userId, @Param("videoId") Long videoId);

    void deleteCollectionVideosByVideoIds(@Param("videoFolderIds") List<Long> videoFolderIds);

    boolean checkVideoInCollectionList(@Param("userId") Long userId, @Param("videoId") Long videoId);
}